import React, { Component } from 'react';
import { TreeSelect,Switch  } from 'antd';


const { TreeNode } = TreeSelect;/* 树形选择 */
class shuxing extends Component {
    state = {
        value: undefined,
    };

    onChange = value => {
        console.log(value);
        this.setState({ value });
    };


    render() {
        return (
            <div style={{margin:"10px 10px"}}>
                <TreeSelect
                    showSearch
                    style={{ width: '150px' }}
                    value={this.state.value}
                    dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
                    placeholder="选择人数"
                    allowClear
                    multiple
                    treeDefaultExpandAll
                    onChange={this.onChange}
                >
                    <TreeNode value="parent 1" title="成人">
                    </TreeNode>
                    <TreeNode value="parent 2" title="儿童">
                        {/* <TreeNode value="leaf1" title="my leaf" />
                        <TreeNode value="leaf2" title="your leaf" /> */}
                    </TreeNode>
                    <TreeNode value="parent 3" title="婴儿">
                        {/* <TreeNode value="sss" title={<b style={{ color: '#08c' }}>sss</b>} /> */}
                    </TreeNode>
                </TreeSelect>

            </div>
        );
    }
}

export default shuxing;